import request from "@/utils/request";

/**
 * 保存对象
 * @param data
 * @returns {AxiosPromise}
 */
export function saveEntity(data) {
  return request({
    url: "rest/api/fwfl/manager",
    method: "post",
    data
  });
}

/**
 * 更新对象
 * @param data
 * @returns {AxiosPromise}
 */
export function updateEntity(data) {
  return request({
    url: "rest/api/fwfl/manager/update",
    method: "post",
    data
  });
}

/**
 * 删除对象
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteEntity(data) {
  return request({
    url: "rest/api/fwfl/manager/del",
    method: "post",
    data
  });
}

/**
 * 分页查询 lb 1： 主分类，2：二级分类
 * @param params
 * @returns {AxiosPromise}
 */
export function queryAllByPager(params) {
  return request({
    url: "rest/api/fwfl/manager",
    method: "get",
    params
  });
}

/**
 * 保存服务关联关系
 * @param data
 * @returns {AxiosPromise}
 */
export function saveFwflService(data) {
  return request({
    url: "rest/api/fwfl/manager/service",
    method: "post",
    data
  });
}

/**
 * 查询分类服务
 * @param params
 * @returns {AxiosPromise}
 */
export function queryAllFwflService(params) {
  return request({
    url: "rest/api/fwfl/manager/service",
    method: "get",
    params
  });
}

/**
 * 查询全部服务分类信息
 * @returns {AxiosPromise}
 */
export function queryAllFwfl() {
  return request({
    url: "rest/config/api/fwfl",
    method: "get"
  });
}

/**
 * 保存全部服务分类信息
 * 服务-分类
 * @param data
 * @returns {AxiosPromise}
 */
export function saveAllServiceFl(data) {
  return request({
    url: "rest/api/fwfl/manager/fl",
    method: "post",
    data
  });
}

/**
 * 根据服务id查询分类信息
 * @param params
 * @returns {AxiosPromise}
 */
export function queryAllServiceFl(params) {
  return request({
    url: "rest/api/fwfl/manager/fl",
    method: "get",
    params
  });
}
